#include "pmdlist.h"
 
int
main (void)
{
        /* GObject 库的类型管理系统的初始化 */
        g_type_init ();
 
        PMDList *list;
        /*实例化PMDList类对象，参数可变，第一个是类型，最后一个是NULL；中间参数成对出现，一对参数中，第一个参数是变量名称，第二个变量是变量内容。*/
        list = g_object_new (PM_TYPE_DLIST,
                             "head", NULL,
                             "tail", NULL,
                             NULL);
        /*可以通过g_object_get_property 或g_object_set_property 获取和设置属性*/
        GValue val = {0};         
        g_value_init (&val,G_TYPE_POINTER);
        g_object_get_property (G_OBJECT(list), "tail", &val);
        g_object_set_property (G_OBJECT(list), "head", &val);
        g_value_unset (&val);
        /*也可以通过g_object_set 和 g_object_get 设置和获取属性，方法类似g_object_new*/
        g_object_unref (list);
        return 0;
}
